
interface ML_ComponentType {
	getTabeleData(): Object
	getConfigViewData() : any,
}


export default class ML_Component implements ML_ComponentType {

	public _id : number | string
	public tag?: string
	public remark?: string
	public compontName?: string
	[propName: string]: any

	public _attrList ?: Array<any>
	public _config_tabs ?: Array<any>
	
	constructor(data ?:object) {
		this._id = ""
		this._config_tabs = [ {key: 1 , text : '属性'}, {key: 2 , text : '事件'}, {key: 3 , text : '方法'}, {key: 4 , text : '插槽'}]

		this._attrList = []


		if(data) {
			for (const key in data) {
					const element = data[ key ];
					this[key] = element
			}

		}
	}


	getTabeleData(){
		let obj = { _id: this._id, tag: this.tag , compontName: this.compontName}
		return obj
	}

	// 给配置页面渲染的数据
	getConfigViewData() {
		return this._config_tabs
	}

}